package jpa.entitys.promis.construction;

import java.io.Serializable;
import javax.persistence.*;

/**
 * The primary key class for the PURCHASE_ORDER_BUDGET database table.
 * 
 */
@Embeddable
public class PurchaseOrderBudgetPK implements Serializable {
	//default serial version id, required for serializable classes.
	private static final long serialVersionUID = 1L;

	@Column(unique=true, nullable=false, length=2)
	private String company;

	@Column(unique=true, nullable=false, length=30)
	private String project;

	@Column(name="PO_TYPE", unique=true, nullable=false, length=2)
	private String poType;

	@Column(name="PO_SERIES", unique=true, nullable=false, length=4)
	private String poSeries;

	@Column(name="PO_NO", unique=true, nullable=false, precision=6)
	private long poNo;

	@Column(name="REVISION_NO", unique=true, nullable=false, precision=22)
	private long revisionNo;

	@Column(name="PO_SEQ_NO", unique=true, nullable=false, precision=3)
	private long poSeqNo;

	@Column(name="SEQ_NO", unique=true, nullable=false, precision=22)
	private long seqNo;

    public PurchaseOrderBudgetPK() {
    }
	public String getCompany() {
		return this.company;
	}
	public void setCompany(String company) {
		this.company = company;
	}
	public String getProject() {
		return this.project;
	}
	public void setProject(String project) {
		this.project = project;
	}
	public String getPoType() {
		return this.poType;
	}
	public void setPoType(String poType) {
		this.poType = poType;
	}
	public String getPoSeries() {
		return this.poSeries;
	}
	public void setPoSeries(String poSeries) {
		this.poSeries = poSeries;
	}
	public long getPoNo() {
		return this.poNo;
	}
	public void setPoNo(long poNo) {
		this.poNo = poNo;
	}
	public long getRevisionNo() {
		return this.revisionNo;
	}
	public void setRevisionNo(long revisionNo) {
		this.revisionNo = revisionNo;
	}
	public long getPoSeqNo() {
		return this.poSeqNo;
	}
	public void setPoSeqNo(long poSeqNo) {
		this.poSeqNo = poSeqNo;
	}
	public long getSeqNo() {
		return this.seqNo;
	}
	public void setSeqNo(long seqNo) {
		this.seqNo = seqNo;
	}

	public boolean equals(Object other) {
		if (this == other) {
			return true;
		}
		if (!(other instanceof PurchaseOrderBudgetPK)) {
			return false;
		}
		PurchaseOrderBudgetPK castOther = (PurchaseOrderBudgetPK)other;
		return 
			this.company.equals(castOther.company)
			&& this.project.equals(castOther.project)
			&& this.poType.equals(castOther.poType)
			&& this.poSeries.equals(castOther.poSeries)
			&& (this.poNo == castOther.poNo)
			&& (this.revisionNo == castOther.revisionNo)
			&& (this.poSeqNo == castOther.poSeqNo)
			&& (this.seqNo == castOther.seqNo);

    }
    
	public int hashCode() {
		final int prime = 31;
		int hash = 17;
		hash = hash * prime + this.company.hashCode();
		hash = hash * prime + this.project.hashCode();
		hash = hash * prime + this.poType.hashCode();
		hash = hash * prime + this.poSeries.hashCode();
		hash = hash * prime + ((int) (this.poNo ^ (this.poNo >>> 32)));
		hash = hash * prime + ((int) (this.revisionNo ^ (this.revisionNo >>> 32)));
		hash = hash * prime + ((int) (this.poSeqNo ^ (this.poSeqNo >>> 32)));
		hash = hash * prime + ((int) (this.seqNo ^ (this.seqNo >>> 32)));
		
		return hash;
    }
}